
class Calc {

public static void main ( String[] args )
{
    System.out.println ("Desk Calculator: operators are *, /, +, -, ^, () \n");
    if ( args.length != 1 ) {
        System.out.println ( "Usage:  calc  expression\n" );
        return; 
    } 

    SlkToken    scanner = new SlkToken ( args[0] );
    SlkError    error = new SlkError ( scanner );
    SlkAction   action = new SlkAction ( scanner );

    SlkParser.parse  ( action, scanner, error, (short) 0 );

    System.out.println ("=====================" );
    System.out.println ("show_parse_derivation" );
    System.out.println ("=====================" );
    action.show_parse_derivation ();
    System.out.println ("=====================" );
    System.out.println ("show_tree" );
    System.out.println ("=====================" );
    action.show_tree ();
    System.out.println ("=====================" );
    System.out.print   ( args[0] );
    System.out.println ( " = " + action.get_answer() );

}

}; 
